package com.amazon.ags.client.whispersync;

import android.content.Context;
import android.util.Log;
import com.amazon.ags.client.whispersync.zip.SimpleZipUtil;
import com.amazon.ags.client.whispersync.zip.ZipUtil;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;

public class GameSavePackager
{
  private static final String FEATURE_NAME = "STC";
  private static final String TAG = "STC_" + GameSavePackager.class.getSimpleName();
  private final Context context;
  private SafeFilenameFilterWrapper filterWrapper;
  private final ZipUtil zipUtil = new SimpleZipUtil();

  public GameSavePackager(Context paramContext)
  {
    this(paramContext, null);
  }

  public GameSavePackager(Context paramContext, FilenameFilter paramFilenameFilter)
  {
    this.context = paramContext;
    this.filterWrapper = new SafeFilenameFilterWrapper();
    this.filterWrapper.setFilter(paramFilenameFilter);
  }

  public byte[] pack()
    throws IOException
  {
    Log.d(TAG, "Entering pack()...");
    File localFile = this.context.getFilesDir().getParentFile();
    return this.zipUtil.zipToByteArray(localFile, this.filterWrapper);
  }

  public final void setFilter(FilenameFilter paramFilenameFilter)
  {
    this.filterWrapper.setFilter(paramFilenameFilter);
  }

  public void unpack(byte[] paramArrayOfByte)
    throws IOException
  {
    Log.d(TAG, "Entering unpack()...");
    File localFile = this.context.getFilesDir().getParentFile();
    this.zipUtil.unzip(paramArrayOfByte, localFile);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.ags.client.whispersync.GameSavePackager
 * JD-Core Version:    0.6.2
 */